import request from '@/utils/request'

export function login(data) {
    return fetch( '/vue-element-admin/user/login', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        body: JSON.stringify( data )
    } )
}

export function getInfo(token) {
    return fetch( '/vue-element-admin/user/info', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json'
        },
        params: { token }
    } )
}

export function logout(token) {
    return request( {
        url: '/vue-element-admin/user/logout',
        method: 'post',
        params: { token }
    } )
}
